package net.sx.minemodule.mvp.activities;

import android.os.Bundle;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.homegoods.aroutercomment.ARouterPath;
import com.kedll.library.base.MyBaseFragmentActivity;

import net.sx.minemodule.R;
import net.sx.minemodule.databinding.MineActivityMineMedalBinding;
import net.sx.minemodule.mvp.presenters.MineMedalPresenter;
import net.sx.minemodule.mvp.views.MineMedalView;

/**
 * add shibo.zheng
 * 19/06/13
 * 我的奖牌 activity
 */

@Route(path = ARouterPath.PATH_MINE_MEDAL)
public class MineMedalActivity extends MyBaseFragmentActivity<MineActivityMineMedalBinding, MineMedalPresenter> implements MineMedalView {
    private String medalType;

    @Override
    protected int getLayout() {
        return R.layout.mine_activity_mine_medal;
    }

    @Override
    protected void initEvent() {

    }

    @Override
    protected MineMedalPresenter getPresenter() {
        return new MineMedalPresenter(this);
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        super.initData(savedInstanceState);
        setTitle("我的奖牌");
        mBinding.medalInfo.setOnClickListener(v -> {
            medalType = "medalInfo";
            ARouter.getInstance().build(ARouterPath.PATH_RECORD_INFO).withString("recordInfoType", medalType).navigation();
        });

        mBinding.commentProblem.setOnClickListener(v -> ARouter.getInstance().build(ARouterPath.PATH_COMMON_PROBLEM).navigation());

    }

    @Override
    protected void initToolBar(Bundle savedInstanceState) {
        super.initToolBar(savedInstanceState);
        setTopRightButton("历史奖牌记录", 0, v -> {
            medalType = "medalHistory";
            ARouter.getInstance().build(ARouterPath.PATH_RECORD_INFO).withString("recordInfoType", medalType).navigation();
        });
    }
}
